package com.buyu.mvvm.mvvm.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;

import com.buyu.mvvm.mvvm.activity.BaseActivity;

import dagger.android.support.AndroidSupportInjection;


/**
 * Created by liang-ll on 2018/11/14.
 */

public class BaseFragment extends Fragment{

    private BaseActivity activity;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AndroidSupportInjection.inject(this);
        activity= (BaseActivity) getActivity();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        activity=null;
    }

    public void showLoading(){
        activity.showLoading();
    }

    public void closeLoading(){
        activity.closeLoading();
    }
}
